package cn.com.chengmandian.core.redis.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum BikeSuperviseActionEnum {
    BIKE_REGISTER(1, "新车注册"),
    USER_BORROW_BIKE(2, "用户取车"),
    USER_RETURN_BIKE(3, "用户还车"),
    BIKE_LOCATION(4, "车辆位置"),
    USER_BLACK(5, "用户拉黑"),
    OPERATION_STATION(6, "站点信息"),
    OPS_USER(7, "运维人员");

    private Integer code;
    private String name;

    public static BikeSuperviseActionEnum getByCode(Integer code){
        if(code == null){
            return null;
        }else {
            BikeSuperviseActionEnum[] bikeSuperviseActionEnums = values();
            for(BikeSuperviseActionEnum bikeSuperviseActionEnum : bikeSuperviseActionEnums){
                if(bikeSuperviseActionEnum.getCode().equals(code)) {
                    return bikeSuperviseActionEnum;
                }
            }
        }
        return null;
    }
}
